{"id":11568,"date":"2017-08-08T12:06:31","date_gmt":"2017-08-08T16:06:31","guid":{"rendered":"https:\/\/www.gravityhelp.com\/?p=11568"},"modified":"2019-10-01T19:34:08","modified_gmt":"2019-10-01T23:34:08","slug":"gravity-forms-rest-api-v2-rc1-released","status":"publish","type":"post","link":"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/","title":{"rendered":"Gravity Forms REST API v2 RC1 Released"},"content":{"rendered":"<p>The Gravity Forms REST API version 2.0-rc-1 is now available on the <a href=\"\/my-account\/downloads\/\" rel=\"nofollow\">downloads<\/a> page. This a developer-focused, feature plugin which contains\u00a0version 2 of the current\u00a0<a href=\"https:\/\/docs.www.gravityforms.com\/web-api\/\">Web\/REST API.<\/a>\u00a0It will soon be added to the Gravity Forms core so we encourage developers to give their feedback now.<br \/>\n<!--more--><\/p>\n<p>The aim\u00a0of version 2 is\u00a0to dovetail with the WordPress REST API in terms of routing, discovery, authentication, usage,\u00a0extensibility and best practices. It also\u00a0provides the solid foundation we need for the development of future versions of Gravity Forms and add-ons.<\/p>\n<p>Version 2 will work alongside\u00a0version 1\u00a0but users will have the option to turn off version 1. Support for version 1 will be phased out so it&#8217;s very important that\u00a0developers begin\u00a0adding support for version 2 now.<\/p>\n<p>Please send all your bug reports, questions and comments\u00a0by opening a <a href=\"https:\/\/www.gravityforms.com\/support\/\">support ticket<\/a>.\u00a0The development version of the plugin can be found in the public <a href=\"https:\/\/github.com\/gravityforms\/gravityformsrestapi\">repository<\/a> on GitHub.<\/p>\n<h2>Upgrading to Version 2<\/h2>\n<p>The API is intended to feel as familiar as possible to developers who have worked with the WordPress REST API. The endpoints are largely the same as version 1, however, the responses are slightly different and authentication is no longer handled by Gravity Forms.<\/p>\n<p>The following <strong>breaking changes<\/strong> are required by clients to consume version 2:<\/p>\n<h3>Content-Type<\/h3>\n<p>The API accepts both standard form fields and JSON content types. When sending JSON, the content-type request header must be set to &#8220;application\/json&#8221;. If the content-type is omitted then the request will be interpreted as &#8220;application\/x-www-form-urlencoded&#8221;.<\/p>\n<h3><a id=\"user-content-example\" class=\"anchor\" href=\"https:\/\/github.com\/gravityforms\/gravityformsrestapi#example\"><\/a><a id=\"user-content-no-response-envelope\" class=\"anchor\" href=\"https:\/\/github.com\/gravityforms\/gravityformsrestapi#no-response-envelope\"><\/a>No Response Envelope<\/h3>\n<p>The response will not be enveloped by default as in version 1. This means that the response will not be a JSON string containing the &#8220;status&#8221; and &#8220;response&#8221; &#8211; the body will contain the response and the HTTP code will contain the status code.<\/p>\n<p>The WP-API will add an envelope to the response if the <em>_envelope<\/em> parameter is included in the request.<\/p>\n<h3><a id=\"user-content-wordpress-cookie-authentication-nonce\" class=\"anchor\" href=\"https:\/\/github.com\/gravityforms\/gravityformsrestapi#wordpress-cookie-authentication-nonce\"><\/a>Authentication<\/h3>\n<p>Authentication is now\u00a0no longer handled by Gravity Forms.<\/p>\n<p>If you&#8217;re using cookie authentication, WordPress supports cookie authentication out of the box so you&#8217;ll just need<br \/>\nto change the way the nonce is created and sent. Create the nonce using wp_create_nonce( &#8216;wp_rest&#8217; ) and send it<br \/>\nin the _wpnonce data parameter (either POST data or in the query for GET requests), or via the X-WP-Nonce header.<\/p>\n<p>The signature authentication used in version 1 has been removed in version 2. If you&#8217;re using signature authentication then you&#8217;ll need to implement either Basic or OAuth authentication for the WordPress REST API. Further details here:<\/p>\n<p><a href=\"http:\/\/v2.wp-api.org\/guide\/authentication\/\">WordPress REST API authentication documentation<\/a><br \/>\n<a href=\"https:\/\/code.tutsplus.com\/tutorials\/wp-rest-api-setting-up-and-using-basic-authentication--cms-24762\">WP REST API: Setting Up and Using Basic Authentication<\/a><br \/>\n<a href=\"https:\/\/code.tutsplus.com\/tutorials\/wp-rest-api-setting-up-and-using-oauth-10a-authentication--cms-24797\">WP REST API: Setting Up and Using OAuth 1.0a Authentication<\/a><\/p>\n<h3><a id=\"user-content-form-submissions\" class=\"anchor\" href=\"https:\/\/github.com\/gravityforms\/gravityformsrestapi#form-submissions\"><\/a>Form Submissions<\/h3>\n<p>The Form Submissions endpoint now accepts application\/json, application\/x-www-form-urlencoded and multipart\/form-data content types. With the introduction of support for the multipart\/form-data content type files can be sent to single file upload fields.<\/p>\n<p>Request values should be sent all together instead of in separate elements for input_values, field_values, target_page and source_page.<\/p>\n<p><strong>Example body of a JSON form submission:<\/strong><\/p>\n<div class=\"highlight highlight-source-json\">\n<pre><code>{\r\n    <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>input_1<span class=\"pl-pds\">\"<\/span><\/span>: <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>test<span class=\"pl-pds\">\"<\/span><\/span>,\r\n    <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>field_values<span class=\"pl-pds\">\"<\/span><\/span> : <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span><span class=\"pl-pds\">\"<\/span><\/span>,\r\n    <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>source_page<span class=\"pl-pds\">\"<\/span><\/span>: <span class=\"pl-c1\">1<\/span>,\r\n    <span class=\"pl-s\"><span class=\"pl-pds\">\"<\/span>target_page<span class=\"pl-pds\">\"<\/span><\/span>: <span class=\"pl-c1\">0<\/span>\r\n}<\/code><\/pre>\n<\/div>\n<h3><a id=\"user-content-post-single-resources\" class=\"anchor\" href=\"https:\/\/github.com\/gravityforms\/gravityformsrestapi#post-single-resources\"><\/a>POST Single Resources<\/h3>\n<p>In order to maintain consistency with the WP API, the POST \/entries and POST \/forms endpoints no longer accept collections. This means that it&#8217;s no longer possible to create multiple entries or forms in a single request.<\/p>\n<p>&nbsp;<\/p>\n<p>For further technical details, check out the readme.md file in the plugin folder.<\/p>\n<h2>REST API Add-On v2.0 Changelog<\/h2>\n<ul>\n<li>Added the Location header when the confirmation is a redirect.<\/li>\n<li>Added sanitization to the \/forms endpoint.<\/li>\n<li>Added the POST \/entries\/&lt;entry-id&gt;\/notifications endpoint which (re)sends notifications.<\/li>\n<li>Added the _fields query param to the GET \/entries, GET \/entries\/&lt;entry-id&gt; and GET \/forms\/&lt;form-id&gt;\/entries endpoints.<\/li>\n<li>Added the include query param to the GET \/entries.<\/li>\n<li>Fixed the status code for invalid submissions.<\/li>\n<li>Changed the &#8216;labels&#8217; query param to &#8216;_labels&#8217; to match WP API properties.<\/li>\n<li>Removed the GET \/entries\/&lt;entry-id&gt;\/fields\/ and GET \/entries\/&lt;entry-id&gt;\/fields\/&lt;field-ids&gt; endpoints.<\/li>\n<li>Removed support for semicolon separated entry IDs in the GET \/entries endpoint. Use the include query param instead.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><a href=\"\/gravity-forms-rest-api-v2-beta-2-released\/\">Read the release notes for beta 2.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Gravity Forms REST API version 2.0-rc-1 is now available on the downloads page. This a developer-focused, feature plugin which contains\u00a0version 2 of the current\u00a0Web\/REST API.\u00a0It will soon be added to the Gravity Forms core so we encourage developers to give their feedback now.<\/p>\n","protected":false},"author":1533,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[216],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v17.2 (Yoast SEO v17.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<meta name=\"description\" content=\"The Gravity Forms REST API version 2.0-rc-1 is now available on the downloads page. This a developer-focused, feature plugin.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Gravity Forms REST API v2 RC1 Released\" \/>\n<meta property=\"og:description\" content=\"The Gravity Forms REST API version 2.0-rc-1 is now available on the downloads page. This a developer-focused, feature plugin.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/\" \/>\n<meta property=\"og:site_name\" content=\"Gravity Forms\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/GravityForms\" \/>\n<meta property=\"article:published_time\" content=\"2017-08-08T16:06:31+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-10-01T23:34:08+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@GravityForms\" \/>\n<meta name=\"twitter:site\" content=\"@GravityForms\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Steve Henty\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.gravityforms.com\/#organization\",\"name\":\"Gravity Forms\",\"url\":\"https:\/\/www.gravityforms.com\/\",\"sameAs\":[\"https:\/\/www.facebook.com\/GravityForms\",\"https:\/\/www.instagram.com\/gravityforms\/\",\"https:\/\/www.linkedin.com\/company\/gravityforms\/\",\"https:\/\/twitter.com\/GravityForms\"],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.gravityforms.com\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.gravityforms.com\/wp-content\/uploads\/2021\/09\/gravity-forms-logo-horizontal-744.png\",\"contentUrl\":\"https:\/\/www.gravityforms.com\/wp-content\/uploads\/2021\/09\/gravity-forms-logo-horizontal-744.png\",\"width\":774,\"height\":400,\"caption\":\"Gravity Forms\"},\"image\":{\"@id\":\"https:\/\/www.gravityforms.com\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.gravityforms.com\/#website\",\"url\":\"https:\/\/www.gravityforms.com\/\",\"name\":\"Gravity Forms\",\"description\":\"WordPress Contact Forms\",\"publisher\":{\"@id\":\"https:\/\/www.gravityforms.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.gravityforms.com\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/#webpage\",\"url\":\"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/\",\"name\":\"Gravity Forms REST API v2 RC1 Released - Gravity Forms\",\"isPartOf\":{\"@id\":\"https:\/\/www.gravityforms.com\/#website\"},\"datePublished\":\"2017-08-08T16:06:31+00:00\",\"dateModified\":\"2019-10-01T23:34:08+00:00\",\"description\":\"The Gravity Forms REST API version 2.0-rc-1 is now available on the downloads page. This a developer-focused, feature plugin.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Gravity Forms\",\"item\":\"https:\/\/www.gravityforms.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"News &amp; Updates\",\"item\":\"https:\/\/www.gravityforms.com\/category\/news\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Gravity Forms REST API v2 RC1 Released\"}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/#webpage\"},\"author\":{\"@id\":\"https:\/\/www.gravityforms.com\/#\/schema\/person\/8d02f2763916bbd95fe89c7a3c30aee0\"},\"headline\":\"Gravity Forms REST API v2 RC1 Released\",\"datePublished\":\"2017-08-08T16:06:31+00:00\",\"dateModified\":\"2019-10-01T23:34:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/#webpage\"},\"wordCount\":696,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.gravityforms.com\/#organization\"},\"articleSection\":[\"News &amp; Updates\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/#respond\"]}]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.gravityforms.com\/#\/schema\/person\/8d02f2763916bbd95fe89c7a3c30aee0\",\"name\":\"Steve Henty\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.gravityforms.com\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0bb079bc87d324e56b640a96b35124ac?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0bb079bc87d324e56b640a96b35124ac?s=96&d=mm&r=g\",\"caption\":\"Steve Henty\"},\"url\":\"https:\/\/www.gravityforms.com\/author\/stevehenty\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"description":"The Gravity Forms REST API version 2.0-rc-1 is now available on the downloads page. This a developer-focused, feature plugin.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/","og_locale":"en_US","og_type":"article","og_title":"Gravity Forms REST API v2 RC1 Released","og_description":"The Gravity Forms REST API version 2.0-rc-1 is now available on the downloads page. This a developer-focused, feature plugin.","og_url":"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/","og_site_name":"Gravity Forms","article_publisher":"https:\/\/www.facebook.com\/GravityForms","article_published_time":"2017-08-08T16:06:31+00:00","article_modified_time":"2019-10-01T23:34:08+00:00","twitter_card":"summary_large_image","twitter_creator":"@GravityForms","twitter_site":"@GravityForms","twitter_misc":{"Written by":"Steve Henty","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Organization","@id":"https:\/\/www.gravityforms.com\/#organization","name":"Gravity Forms","url":"https:\/\/www.gravityforms.com\/","sameAs":["https:\/\/www.facebook.com\/GravityForms","https:\/\/www.instagram.com\/gravityforms\/","https:\/\/www.linkedin.com\/company\/gravityforms\/","https:\/\/twitter.com\/GravityForms"],"logo":{"@type":"ImageObject","@id":"https:\/\/www.gravityforms.com\/#logo","inLanguage":"en-US","url":"https:\/\/www.gravityforms.com\/wp-content\/uploads\/2021\/09\/gravity-forms-logo-horizontal-744.png","contentUrl":"https:\/\/www.gravityforms.com\/wp-content\/uploads\/2021\/09\/gravity-forms-logo-horizontal-744.png","width":774,"height":400,"caption":"Gravity Forms"},"image":{"@id":"https:\/\/www.gravityforms.com\/#logo"}},{"@type":"WebSite","@id":"https:\/\/www.gravityforms.com\/#website","url":"https:\/\/www.gravityforms.com\/","name":"Gravity Forms","description":"WordPress Contact Forms","publisher":{"@id":"https:\/\/www.gravityforms.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.gravityforms.com\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/#webpage","url":"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/","name":"Gravity Forms REST API v2 RC1 Released - Gravity Forms","isPartOf":{"@id":"https:\/\/www.gravityforms.com\/#website"},"datePublished":"2017-08-08T16:06:31+00:00","dateModified":"2019-10-01T23:34:08+00:00","description":"The Gravity Forms REST API version 2.0-rc-1 is now available on the downloads page. This a developer-focused, feature plugin.","breadcrumb":{"@id":"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Gravity Forms","item":"https:\/\/www.gravityforms.com\/"},{"@type":"ListItem","position":2,"name":"News &amp; Updates","item":"https:\/\/www.gravityforms.com\/category\/news\/"},{"@type":"ListItem","position":3,"name":"Gravity Forms REST API v2 RC1 Released"}]},{"@type":"Article","@id":"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/#article","isPartOf":{"@id":"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/#webpage"},"author":{"@id":"https:\/\/www.gravityforms.com\/#\/schema\/person\/8d02f2763916bbd95fe89c7a3c30aee0"},"headline":"Gravity Forms REST API v2 RC1 Released","datePublished":"2017-08-08T16:06:31+00:00","dateModified":"2019-10-01T23:34:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/#webpage"},"wordCount":696,"commentCount":0,"publisher":{"@id":"https:\/\/www.gravityforms.com\/#organization"},"articleSection":["News &amp; Updates"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.gravityforms.com\/blog\/gravity-forms-rest-api-v2-rc1-released\/#respond"]}]},{"@type":"Person","@id":"https:\/\/www.gravityforms.com\/#\/schema\/person\/8d02f2763916bbd95fe89c7a3c30aee0","name":"Steve Henty","image":{"@type":"ImageObject","@id":"https:\/\/www.gravityforms.com\/#personlogo","inLanguage":"en-US","url":"https:\/\/secure.gravatar.com\/avatar\/0bb079bc87d324e56b640a96b35124ac?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0bb079bc87d324e56b640a96b35124ac?s=96&d=mm&r=g","caption":"Steve Henty"},"url":"https:\/\/www.gravityforms.com\/author\/stevehenty\/"}]}},"_links":{"self":[{"href":"https:\/\/www.gravityforms.com\/wp-json\/wp\/v2\/posts\/11568"}],"collection":[{"href":"https:\/\/www.gravityforms.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gravityforms.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gravityforms.com\/wp-json\/wp\/v2\/users\/1533"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gravityforms.com\/wp-json\/wp\/v2\/comments?post=11568"}],"version-history":[{"count":0,"href":"https:\/\/www.gravityforms.com\/wp-json\/wp\/v2\/posts\/11568\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gravityforms.com\/wp-json\/wp\/v2\/media?parent=11568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gravityforms.com\/wp-json\/wp\/v2\/categories?post=11568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gravityforms.com\/wp-json\/wp\/v2\/tags?post=11568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}